// pages/report/report.js
import Toast from '@vant/weapp/toast/toast'
import {request} from '../../utils/request.js'
Page({
  findExamList(){//考试信息
    let vm = this
    wx.getStorage({key:'schoolInfo'}).then(data=>{
      request({
        url:'/review-paper/exam/findExamList',
        data:{
          schoolId:data.data.id,
          examStatus: 2
        },
        success (res) {
          if(res.data.status == 1){
            vm.setData({
              array: res.data.data.rows
            })
          }else{
            Toast.fail(res.data.msg);
          }
        }
      })
    })
    
  },
//排行榜
  toPaiming(e){
    wx.navigateTo({
      url: '../totalRanking/totalRanking?id=' +e.target.dataset.data.id,
    })
  },
  //得分表
  toSubjectRanking(e){
    wx.navigateTo({
      url: '../subjectRanking/subjectRanking?id=' +e.target.dataset.data.id,
    })
  },
  data: {
    index:0,
    array:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onShow() {
    this.findExamList()

  }
})